package test.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import test.dao.PersonDao;
import test.entity.Person;


@Service
public class PersonService {

	@Autowired private PersonDao personDao;
	
	public void addPerson(Person person) {
		personDao.addPerson(person);
	}
	public List<Person> getPersons() {
		return personDao.getPersons();
	}
	public void deletePerson(int id) {
		personDao.deletePersonById(id);
	
	}
	public void updatePerson(Person person) {
		personDao.updatePerson(person);
	}
	public PersonService() {
	}
	public Person getPersonById(int id) {
		return personDao.getPersonById(id);
	}

}
